<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
        <title>Document</title>
        <script>
            /* 
                替代字符  |
            */
            var str = "google";
            var box = /google|baidu|bing/;

            // alert(box.test(str));


            /* 
                修饰符
                    i  忽略大小写
                    g  全局匹配
                    m  换行匹配
                    【注】如果在字符串，遇到换行，重新开始计算行首。
            */

            var str = "1、ba13idu\n2、go33ogle\n3、b12ing";
            var box = /^\d/gm;
            alert(str.replace(box, "*"));
        </script>
    </head>
    <body>
        
    </body>
</html>